package com.dg.home

import com.dg.tools.ImageDataHolder
import com.dg.tools.ImageUtility

class HomeController {

	def home() {
		def dataMap = [:]
		def sliderImageLocations = HomeUtility.getSliderImages()
		
		dataMap.put("sliderImages", sliderImageLocations)
		
		return dataMap
	}
		
	def getSliderImage() {
		ImageDataHolder image = ImageUtility.getImage(params.sliderImagePath)
		
        response.contentType = "image/" + image.getImageType()
        response.outputStream << image.getImagePixelData()
        response.outputStream.flush()
	}
}
